Optimal. Leaf size=56 \[ \frac {e x}{a}+\frac {f x^2}{2 a}-\frac {i (e+f x) \cosh (c+d x)}{a d}+\frac {i f \sinh (c+d x)}{a d^2} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.05, antiderivative size = 56, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 3, integrand size = 29, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.103, Rules used = {5682, 3377,
2717} \begin {gather*} \frac {i f \sinh (c+d x)}{a d^2}-\frac {i (e+f x) \cosh (c+d x)}{a d}+\frac {e x}{a}+\frac {f x^2}{2 a} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2717
Rule 3377
Rule 5682
Rubi steps
\begin {align*} \int \frac {(e+f x) \cosh ^2(c+d x)}{a+i a \sinh (c+d x)} \, dx &=-\frac {i \int (e+f x) \sinh (c+d x) \, dx}{a}+\frac {\int (e+f x) \, dx}{a}\\ &=\frac {e x}{a}+\frac {f x^2}{2 a}-\frac {i (e+f x) \cosh (c+d x)}{a d}+\frac {(i f) \int \cosh (c+d x) \, dx}{a d}\\ &=\frac {e x}{a}+\frac {f x^2}{2 a}-\frac {i (e+f x) \cosh (c+d x)}{a d}+\frac {i f \sinh (c+d x)}{a d^2}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.38, size = 57, normalized size = 1.02 \begin {gather*} -\frac {(c+d x) (-2 d e+c f-d f x)+2 i d (e+f x) \cosh (c+d x)-2 i f \sinh (c+d x)}{2 a d^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 1.05, size = 84, normalized size = 1.50
method | result | size |
risch | \(\frac {f \,x^{2}}{2 a}+\frac {e x}{a}-\frac {i \left (d x f +d e -f \right ) {\mathrm e}^{d x +c}}{2 a \,d^{2}}-\frac {i \left (d x f +d e +f \right ) {\mathrm e}^{-d x -c}}{2 a \,d^{2}}\) | \(70\) |
derivativedivides | \(-\frac {-i f c \cosh \left (d x +c \right )+i e d \cosh \left (d x +c \right )+i f \left (\left (d x +c \right ) \cosh \left (d x +c \right )-\sinh \left (d x +c \right )\right )+f c \left (d x +c \right )-e d \left (d x +c \right )-\frac {f \left (d x +c \right )^{2}}{2}}{d^{2} a}\) | \(84\) |
default | \(-\frac {-i f c \cosh \left (d x +c \right )+i e d \cosh \left (d x +c \right )+i f \left (\left (d x +c \right ) \cosh \left (d x +c \right )-\sinh \left (d x +c \right )\right )+f c \left (d x +c \right )-e d \left (d x +c \right )-\frac {f \left (d x +c \right )^{2}}{2}}{d^{2} a}\) | \(84\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Both result and optimal contain complex but leaf count of result is larger than
twice the leaf count of optimal. 189 vs. \(2 (55) = 110\).
time = 0.32, size = 189, normalized size = 3.38 \begin {gather*} \frac {1}{2} \, f {\left (\frac {2 \, x e^{\left (d x + c\right )}}{a d e^{\left (d x + c\right )} - i \, a d} - \frac {i \, d^{2} x^{2} e^{c} + i \, d x e^{c} - {\left (-i \, d x e^{\left (3 \, c\right )} + i \, e^{\left (3 \, c\right )}\right )} e^{\left (2 \, d x\right )} - {\left (d^{2} x^{2} e^{\left (2 \, c\right )} - 3 \, d x e^{\left (2 \, c\right )} + e^{\left (2 \, c\right )}\right )} e^{\left (d x\right )} + {\left (d x + 1\right )} e^{\left (-d x\right )} + i \, e^{c}}{a d^{2} e^{\left (d x + 2 \, c\right )} - i \, a d^{2} e^{c}}\right )} + \frac {1}{2} \, {\left (\frac {2 \, {\left (d x + c\right )}}{a d} - \frac {i \, e^{\left (d x + c\right )}}{a d} - \frac {i \, e^{\left (-d x - c\right )}}{a d}\right )} e \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.38, size = 79, normalized size = 1.41 \begin {gather*} \frac {{\left (-i \, d f x - i \, d e + {\left (-i \, d f x - i \, d e + i \, f\right )} e^{\left (2 \, d x + 2 \, c\right )} + {\left (d^{2} f x^{2} + 2 \, d^{2} x e\right )} e^{\left (d x + c\right )} - i \, f\right )} e^{\left (-d x - c\right )}}{2 \, a d^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.20, size = 167, normalized size = 2.98 \begin {gather*} \begin {cases} \frac {\left (\left (- 2 i a d^{3} e - 2 i a d^{3} f x - 2 i a d^{2} f\right ) e^{- d x} + \left (- 2 i a d^{3} e e^{2 c} - 2 i a d^{3} f x e^{2 c} + 2 i a d^{2} f e^{2 c}\right ) e^{d x}\right ) e^{- c}}{4 a^{2} d^{4}} & \text {for}\: a^{2} d^{4} e^{c} \neq 0 \\\frac {x^{2} \left (- i f e^{2 c} + i f\right ) e^{- c}}{4 a} + \frac {x \left (- i e e^{2 c} + i e\right ) e^{- c}}{2 a} & \text {otherwise} \end {cases} + \frac {e x}{a} + \frac {f x^{2}}{2 a} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.43, size = 96, normalized size = 1.71 \begin {gather*} \frac {{\left (d^{2} f x^{2} e^{\left (d x + c\right )} + 2 \, d^{2} e x e^{\left (d x + c\right )} - i \, d f x e^{\left (2 \, d x + 2 \, c\right )} - i \, d f x - i \, d e e^{\left (2 \, d x + 2 \, c\right )} - i \, d e + i \, f e^{\left (2 \, d x + 2 \, c\right )} - i \, f\right )} e^{\left (-d x - c\right )}}{2 \, a d^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.38, size = 87, normalized size = 1.55 \begin {gather*} \frac {f\,x^2}{2\,a}+{\mathrm {e}}^{c+d\,x}\,\left (\frac {\left (f-d\,e\right )\,1{}\mathrm {i}}{2\,a\,d^2}-\frac {f\,x\,1{}\mathrm {i}}{2\,a\,d}\right )-{\mathrm {e}}^{-c-d\,x}\,\left (\frac {\left (f+d\,e\right )\,1{}\mathrm {i}}{2\,a\,d^2}+\frac {f\,x\,1{}\mathrm {i}}{2\,a\,d}\right )+\frac {e\,x}{a} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________